package com.dao.impl;

import javax.annotation.Resource;

import org.springframework.orm.hibernate3.HibernateTemplate;
import org.springframework.stereotype.Component;

import com.dao.WorkflowDao;
import com.model.File;
import com.model.Workflow;

@Component("workflowDao")
public class WorkflowDaoImpl implements WorkflowDao {
	private HibernateTemplate hibernateTemplate;

	public HibernateTemplate getHibernateTemplate() {
		return hibernateTemplate;
	}

	@Resource
	public void setHibernateTemplate(HibernateTemplate hibernateTemplate) {
		this.hibernateTemplate = hibernateTemplate;
	}

	public void newWorkflow(Workflow workflowBean) {
//		Workflow wk = new Workflow();
//		wk.setWf_title("text workflow title");
//		File f = new File();
//		f.setF_name("testfile");
//		f.setF_extensionname(".txt");
//		f.setF_formatname("FJ11092RU1");
//		f.setF_authorid("123");
//		wk.setFile(f);
////		this.hibernateTemplate.save(f);
		this.hibernateTemplate.save(workflowBean);
	}

}
